package com.hy.jedis.controller;

import com.hy.jedis.factory.JedisConnectionFactory;
import com.hy.jedis.properties.JedisProperties;
import jakarta.annotation.Resource;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.Jedis;

/**
 * Created With IntelliJ IDEA.
 * Descriptions:
 * User:Mr.Du
 * Date:2023/7/21
 * Time:16:58
 */
@RestController
@RequestMapping("/test")
@RequiredArgsConstructor
public class TestJedisPoolController {

    private final JedisConnectionFactory jedisConnectionFactory;

    @RequestMapping("/jedisPool")
    public void testJedisPool(){
        Jedis jedis = jedisConnectionFactory.getJedis();
        jedis.setex("1", 1000, "12");
        System.out.println(jedis);
    }
}
